package ControlLayer;
import ModelLayer.EmployeeContainer;
import ModelLayer.Employee;
import java.util.ArrayList;

/**
 * Vestbjerg project
 * @GroupB2 (UCN - Computer Science DMAJ0914) 
 */
public class EmployeeCtr
{
    // instance variables
    private EmployeeContainer employeeContainer;

    /**
     * Constructor for objects of class EmployeeCtr
     */
    public EmployeeCtr()
    {
        employeeContainer = EmployeeContainer.getInstance();
    }

    public void createEmployee(String id, String name, String address, String phone, String email) 
    {
        Employee employee = new Employee(id,name,address,phone,email);
        employeeContainer.addEmployee(employee);
    }

    public Employee findEmployee(String id) 
    {
        return employeeContainer.findEmployee(id);
    }

    public void updateEmployee(Employee employee, String id, String name, String address, String phone, String email) 
    {
        employee.setId(id);
        employee.setName(name);
        employee.setAddress(address);
        employee.setPhone(phone);
        employee.setEmail(email);
    }

    public void deleteEmployee(Employee employee) 
    {
        employeeContainer.deleteEmployee(employee);
    }
    
    public ArrayList<String> employeeSort() 
    {
        return employeeContainer.employeeSort();
    }
    
    public ArrayList<Employee> getEmployeeList() 
    {
     return employeeContainer.getEmployeeList();
    }
}
